import request from '@/utils/request'

// 查询单基本信息列表
export function listFormBase(query) {
  return request({
    url: '/base/formBase/list',
    method: 'get',
    params: query
  })
}

// 查询单基本信息详细
export function getFormBase(id) {
  return request({
    url: '/base/formBase/' + id,
    method: 'get'
  })
}

// 保存单基本信息
export function saveFormBase(data) {
  return request({
    url: '/base/formBase/save',
    method: 'post',
    data: data
  })
}

// 删除单基本信息
export function delFormBase(id) {
  return request({
    url: '/base/formBase/' + id,
    method: 'delete'
  })
}

// 导出单基本信息
export function exportFormBase(query) {
  return request({
    url: '/base/formBase/export',
    method: 'get',
    params: query
  })
}

// 查询单基本信息列表
export function formList(query) {
  return request({
    url: '/base/formBase/formList/' + query.formId,
    method: 'get',
    params: query.params
  })
}

// 保存表单基本信息
export function saveFormData(data) {
  return request({
    url: '/base/formBase/saveFormData',
    method: 'post',
    data: data
  })
}

// 删除表单
export function deleteForm(params) {
  return request({
    url: '/base/formBase/deleteForm',
    method: 'delete',
    params: params
  })
}

// 获取生成表单基本信息
export function getByFormIdAndDataId(params) {
  return request({
    url: '/base/formBase/getByFormIdAndDataId',
    method: 'get',
    params: params
  })
}

// 根据formId查询下拉项
export function findListByFormId(formId) {
  return request({
    url: '/select/formSelect/findListByFormId/' + formId,
    method: 'get'
  })
}
